import Vue from 'vue'
import App from './App.vue'
import "./assets/reset.css"
// import ElementUI from "element-ui"; //全局引入
// import "element-ui/lib/theme-chalk/index.css";
// import "amfe-flexible";
import router from "./router/index"
import store from "./Store/index"
import VueRouter from "vue-router";
// ------------------------------------------------------
//moment 插件
import moment from "moment"
// ------------------------------------------------------
Vue.config.productionTip = false;
// Vue.use(ElementUI); //全局引入
import 'element-ui/lib/theme-chalk/index.css'; //全局引入
import './assets/style/global.css'
// 引入要是用的组件

Vue.prototype.$moment = moment;
//--------------------------------------------------------
//学生信息录入
import {
  Tabs,
  TabPane,
  PageHeader,
  Breadcrumb,
  BreadcrumbItem,
  Row,
  Col
} from 'element-ui'
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(PageHeader)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Row)
Vue.use(Col)
// -------------------------------------------------------

// VueRouter  3版本之后的都是 升级后变为了promise对象，重复点击路由报错 push replace
// 统一处理catch
const originPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originPush.call(this, location, onResolve, onReject)
  return originPush.call(this, location).catch(err => err);
}

const originReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location, onResolve, onReject) {
  if (onResolve || onReject) return originReplace.call(this, location, onResolve, onReject)
  return originReplace.call(this, location).catch(err => err);
}
// -------------------------------------------------------
new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')